/* 
 * Bitmain Tech, Home of Professional Bitmain Tech
 * Copyright 2014 Bitmain Tech Inc. and/or its affiliates and other contributors
 * as indicated by the @author tags. All rights reserved.
 * See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 */
package com.bitmain.mmst.domain;

import java.util.Map;

import com.bitmain.mmst.core.base.BasicDomain;
import com.bitmain.ulnar.aider.JSONAider;
import com.google.gson.reflect.TypeToken;

/**
 * 领域模型：矿机机架
 *
 * @author Kweny - enkun.jiang@bitmain.com
 * @since 2015年12月11日
 *
 */
public class MinerShelf extends BasicDomain {
	private static final long serialVersionUID = 5943845467647855409L;
	/**
	 * 矿区ID
	 */
	private Long areaId;
	/**
	 * 矿机类型ID
	 */
	private Long minerTypeId;
	/**
	 * 矿机类型名称
	 */
	private String minerTypeName;
	/**
	 * 矿机类型端口
	 */
	private Integer minerTypePort;
	/**
	 * 机架名称
	 */
	private String name;
	/**
	 * 备注
	 */
	private String remark;
	/**
	 * 货架IP段
	 */
	private String ipBlock;
	/**
	 * 货架IP起始索引
	 */
	private Integer ipBeginning;
	/**
	 * 货架IP结束索引
	 */
	private Integer ipEnd;
	/**
	 * 忽略的IP索引
	 */
	private Integer[] ignores;
	/**
	 * 例外类型矿机，与机架类型不一致的矿机IP及对应类型映射
	 */
	private Map<String, Long> exceptiveTypes;
	private String exceptiveTypesJson;
	/**
	 * 是否启用，true：启用；false停用
	 */
	private Boolean enable;
	
	// 关联查询的字段
	private String areaName; // 矿区名称
	private Boolean areaEnable; // 矿区是否启用

	/**
	 * @return the areaId
	 */
	public Long getAreaId() {
		return areaId;
	}

	/**
	 * @param areaId the areaId to set
	 */
	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}

	/**
	 * @return the minerTypeId
	 */
	public Long getMinerTypeId() {
		return minerTypeId;
	}

	/**
	 * @param minerTypeId the minerTypeId to set
	 */
	public void setMinerTypeId(Long minerTypeId) {
		this.minerTypeId = minerTypeId;
	}

	/**
	 * @return the minerTypeName
	 */
	public String getMinerTypeName() {
		return minerTypeName;
	}

	/**
	 * @param minerTypeName the minerTypeName to set
	 */
	public void setMinerTypeName(String minerTypeName) {
		this.minerTypeName = minerTypeName;
	}

	/**
	 * @return the minerTypePort
	 */
	public Integer getMinerTypePort() {
		return minerTypePort;
	}

	/**
	 * @param minerTypePort the minerTypePort to set
	 */
	public void setMinerTypePort(Integer minerTypePort) {
		this.minerTypePort = minerTypePort;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the remark
	 */
	public String getRemark() {
		return remark;
	}

	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * @return the ipBlock
	 */
	public String getIpBlock() {
		return ipBlock;
	}

	/**
	 * @param ipBlock
	 *            the ipBlock to set
	 */
	public void setIpBlock(String ipBlock) {
		this.ipBlock = ipBlock;
	}

	/**
	 * @return the ipBeginning
	 */
	public Integer getIpBeginning() {
		return ipBeginning;
	}

	/**
	 * @param ipBeginning
	 *            the ipBeginning to set
	 */
	public void setIpBeginning(Integer ipBeginning) {
		this.ipBeginning = ipBeginning;
	}

	/**
	 * @return the ipEnd
	 */
	public Integer getIpEnd() {
		return ipEnd;
	}

	/**
	 * @param ipEnd
	 *            the ipEnd to set
	 */
	public void setIpEnd(Integer ipEnd) {
		this.ipEnd = ipEnd;
	}

	/**
	 * @return the ignores
	 */
	public Integer[] getIgnores() {
		return ignores;
	}

	/**
	 * @param ignores the ignores to set
	 */
	public void setIgnores(Integer[] ignores) {
		this.ignores = ignores;
	}

	/**
	 * @return the exceptiveTypes
	 */
	public Map<String, Long> getExceptiveTypes() {
		return exceptiveTypes;
	}

	/**
	 * @param exceptiveTypes the exceptiveTypes to set
	 */
	public void setExceptiveTypes(Map<String, Long> exceptiveTypes) {
		this.exceptiveTypes = exceptiveTypes;
		this.exceptiveTypesJson = JSONAider.toJson(exceptiveTypes);
	}

	/**
	 * @return the exceptiveTypesJson
	 */
	public String getExceptiveTypesJson() {
		return exceptiveTypesJson;
	}

	/**
	 * @param exceptiveTypesJson the exceptiveTypesJson to set
	 */
	public void setExceptiveTypesJson(String exceptiveTypesJson) {
		this.exceptiveTypesJson = exceptiveTypesJson;
		this.exceptiveTypes = JSONAider.fromJson(exceptiveTypesJson, new TypeToken<Map<String, Long>>() {});
	}

	/**
	 * @return the enable
	 */
	public Boolean getEnable() {
		return enable;
	}

	/**
	 * @param enable the enable to set
	 */
	public void setEnable(Boolean enable) {
		this.enable = enable;
	}

	/**
	 * @return the areaName
	 */
	public String getAreaName() {
		return areaName;
	}

	/**
	 * @param areaName the areaName to set
	 */
	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	/**
	 * @return the areaEnable
	 */
	public Boolean getAreaEnable() {
		return areaEnable;
	}

	/**
	 * @param areaEnable the areaEnable to set
	 */
	public void setAreaEnable(Boolean areaEnable) {
		this.areaEnable = areaEnable;
	}
	
}
